package com.example.demo.service;

import com.example.demo.dao.StudyroomseatDao;
import com.example.demo.entity.StudyroomSeatEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudyroomseatService {

    @Autowired
    private StudyroomseatDao studyroomseatDao;

    /**
     * 通过ID查询单条数据
     */
    public StudyroomSeatEntity queryStudyroomseatById(Integer ssid){
        return studyroomseatDao.queryStudyroomseatById(ssid);
    }

//    /**
//     * 通过ID查询单条数据
//     */
//    public StudyroomSeatEntity queryStudyroomseatBySid(Integer sid){
//        return studyroomseatDao.queryStudyroomseatBySid(sid);
//    }


    /**
     * 通过实体作为筛选条件查询
     */
    public List<StudyroomSeatEntity> queryStudyroomseatAll(){
        return studyroomseatDao.queryStudyroomseatAll();
    }

    /**
     * 新增数据
     */
    public int insertStudyroomseat(StudyroomSeatEntity studyroomseat){
       return studyroomseatDao.insertStudyroomseat(studyroomseat);
    }

    /**
     * 修改数据
     */
    public void updateStudyroomseat(StudyroomSeatEntity studyroomseat){
        studyroomseatDao.updateStudyroomseat(studyroomseat);
    }

    /**
     * 通过主键删除数据
     */
    public void deleteStudyroomseatById(Integer ssid){
        studyroomseatDao.deleteStudyroomseatById(ssid);
    }


    public List<StudyroomSeatEntity>selectBySidStudyroomseat(int sid){
       return studyroomseatDao.selectBySidStudyroomseat(sid);
    }
}